#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>


CLIPPER WNDCENTER()
{
   HWND hWnd = _parni( 1 );
   RECT rctWindow, rctDesktop;
   WORD wLeft, wTop, wWidth, wHeight;

   GetWindowRect( hWnd, &rctWindow );
   GetWindowRect( GetDesktopWindow(), &rctDesktop );

   wWidth  = rctWindow.right - rctWindow.left;
   wHeight = rctWindow.bottom - rctWindow.top;
   wLeft   = ( rctDesktop.right / 2 ) - ( wWidth / 2 );
   wTop    = ( rctDesktop.bottom / 2 ) - ( wHeight / 2 );

   MoveWindow( hWnd, wLeft, wTop, wWidth, wHeight, TRUE );
}
